home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / zapdh013 / part01
Encoding:
Internet Message Format  |  1990-10-14  |  42.6 KB

  1. Path: abcfd20.larc.nasa.gov!amiga-request
  2. From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v90i280: ZapDH0 1.3 - patch 2090 OFS partition to be ZH0:, Part01/01
  4. Reply-To: "John Davis,chem dept, UoC NZ" <CHEM194@canterbury.ac.nz>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v90i280@abcfd20.larc.nasa.gov>
  7. Date: 14 Oct 90 18:27:24 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga
  11.  
  12. Submitted-by: "John Davis,chem dept, UoC NZ" <CHEM194@canterbury.ac.nz>
  13. Posting-number: Volume 90, Issue 280
  14. Archive-name: util/zapdh0-1.3/part01
  15.  
  16. [ uuencoded executables enclosed  ...tad ]
  17.  
  18. a utility for 2090 owners who are sick of the the OFS partition of 
  19. their HD being called DH0:, and who are equally sick of brain-dead
  20. install programs and filerequesters that list only dh0:. Will
  21. rename dh0: to zh0:, allowing you to mount your main (ffs) partition
  22. as dh0:. Also includes a facility to 'clone' the df2: drive as
  23. df1: for people with one internal and one external drive on their
  24. 2000.
  25.  
  26. #!/bin/sh
  27. # This is a shell archive.  Remove anything before this line, then unpack
  28. # it by saving it into a file and typing "sh file".  To overwrite existing
  29. # files, type "sh file -c".  You can also feed this as standard input via
  30. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  31. # will see the following message at the end:
  32. #        "End of archive 1 (of 1)."
  33. # Contents:  listdevs.mod listdevs.uu zapdh0.doc zapdh0.mod zapdh0.uu
  34. # Wrapped by tadguy@abcfd20 on Sun Oct 14 14:27:23 1990
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. if test -f 'listdevs.mod' -a "${1}" != "-c" ; then 
  37.   echo shar: Will not clobber existing file \"'listdevs.mod'\"
  38. else
  39. echo shar: Extracting \"'listdevs.mod'\" \(6787 characters\)
  40. sed "s/^X//" >'listdevs.mod' <<'END_OF_FILE'
  41. XMODULE lister;
  42. X
  43. X(* example code showing how to scan the DOS device list
  44. X   to work out what devices are available to DOS,
  45. X   what their types are ( whether they're a device, a dir etc ),
  46. X   and how to extract info on properties of devices ( host device
  47. X   physical parameters etc )
  48. X*)
  49. X
  50. X(* by J Davis v1.0 10/89            *)
  51. X(*            v1.1 6/90             *)
  52. X(* compiled using TDI M-2 v3.01a    *)
  53. X
  54. X(* thanks to Patrick Horgan for the  code he 
  55. X   posted to UseNet showing how to do the enviroment probing 
  56. X*)
  57. X
  58. XFROM DOSLibrary      IMPORT DOSName,DOSBase,BPTR,BSTR;
  59. XFROM DOSExtensions   IMPORT DosBaseRec,RootNode,DosInfo,DeviceList;
  60. XFROM AmigaUtils      IMPORT PtrFromBPTR;
  61. XFROM SYSTEM          IMPORT NULL;
  62. XFROM InOut           IMPORT WriteString,WriteLn,Write;
  63. XFROM LongInOut       IMPORT WriteLongCard,WriteLongInt,WriteLongHex;
  64. XFROM Libraries       IMPORT OpenLibrary,CloseLibrary;
  65. XFROM DOSLibrary      IMPORT DateStampRec;
  66. XFROM FileHandler     IMPORT DeviceNode,FileSysStartupMsg;
  67. XFROM SYSTEM          IMPORT ADDRESS,BYTE;
  68. X
  69. XTYPE 
  70. X
  71. Xstring = ARRAY [0..255] OF CHAR;
  72. Xstrptr = POINTER TO string;
  73. X
  74. XDOSenv = ARRAY [0..255] OF LONGCARD;
  75. X
  76. XVAR
  77. X
  78. Xourdosbase : POINTER TO DosBaseRec;             (* use this to access dosbase *)
  79. Xinfoptr    : POINTER TO DosInfo;                (* points to DOSinfo node     *)
  80. Xdevlistptr : POINTER TO DeviceList;             (* points to current place is DOS devlist *)
  81. Xdevnodeptr : POINTER TO DeviceNode;             (* used for accessing device nodes *)
  82. Xfssm       : POINTER TO FileSysStartupMsg;      (* used to access the filesystemstartupmessage *)  
  83. Xdosenvptr  : POINTER TO DOSenv;
  84. X
  85. Xnameptr    : strptr;
  86. Xcptr       : POINTER TO CHAR;
  87. Xp          : CARDINAL;
  88. X
  89. X
  90. X
  91. XPROCEDURE WriteBSTR(b:BPTR);
  92. X(* output a BSTR *)
  93. XVAR
  94. Xnptr : strptr;
  95. Xc    : CARDINAL;
  96. XBEGIN
  97. Xnptr:=PtrFromBPTR(b);
  98. XIF nptr^[0]>=CHR(1) THEN
  99. X   FOR c:=1 TO ORD(nptr^[0]) DO
  100. X       Write(nptr^[c]);
  101. X   END;
  102. XEND;
  103. XEND WriteBSTR;
  104. X
  105. X
  106. XBEGIN
  107. X
  108. XDOSBase:=OpenLibrary(DOSName,0);   
  109. X(* open the dos lib *)
  110. X
  111. XWriteString("listdevs v1.2 By John Davis 6/90");
  112. XWriteLn;
  113. X
  114. Xourdosbase:=DOSBase;                              
  115. X(* get a usable pointer onto dosbase *)
  116. X
  117. Xinfoptr:=PtrFromBPTR(ourdosbase^.dlRoot^.rnInfo); 
  118. X(* get pointer to dosinfo struct *)
  119. X
  120. Xdevlistptr:=PtrFromBPTR(infoptr^.diDevInfo);      
  121. X(* get a pointer to start of devlist *)
  122. X
  123. XWHILE devlistptr<>NULL DO
  124. X      (* scan down device list checking as we go *)
  125. X          
  126. X      (* print out the device name *)
  127. X      WriteString("node name : ");
  128. X      WriteBSTR(devlistptr^.dlName);
  129. X      WriteLn;
  130. X      
  131. X      Write(CHR(9));
  132. X      
  133. X      (* determine the nodes type and display it *)
  134. X      IF devlistptr^.dlType=0 THEN
  135. X         WriteString("Type         : DEV ");
  136. X         WriteLn;
  137. X      ELSIF devlistptr^.dlType=1 THEN
  138. X         WriteString("Type         : DIR ");
  139. X         WriteLn;
  140. X      ELSIF devlistptr^.dlType=2 THEN
  141. X         WriteString("Type         : VOL ");
  142. X         WriteLn;
  143. X      ELSE
  144. X         WriteString("Type         : ??? ");
  145. X         WriteLn;
  146. X      END;
  147. X         
  148. X      (* I'm primarily interested in devices,  
  149. X             VOLUMES are simply currently mounted disks
  150. X             DIRS are assigned logical drives ( such as fonts: )
  151. X      *)
  152. X
  153. X      IF devlistptr^.dlType=0 THEN
  154. X         (* node is a device node, extract extra info *)
  155. X        
  156. X         devnodeptr:=ADDRESS(devlistptr);          
  157. X         (* transform to right type *)
  158. X          
  159. X         fssm:=PtrFromBPTR(devnodeptr^.dnStartup); 
  160. X         (* get pointer to filesystemstartup block *)
  161. X         
  162. X         dosenvptr:=PtrFromBPTR(fssm^.fssmEnviron);
  163. X         (* get pointer into enviroment block *)
  164. X                  
  165. X         (* if there's no fssm the fssmptr _should_ be null, but this
  166. X            doesn't seem to be always true ( espec on par, prt and ser )
  167. X            so check to see if the dosenv[de_tablesize] makes sense also
  168. X         *)
  169. X         IF (fssm<>NULL) AND (dosenvptr^[0]<=16) THEN
  170. X
  171. X            (* printout host device for this dev *)
  172. X            Write(CHR(9));
  173. X            WriteString("Device       : ");
  174. X            WriteBSTR(fssm^.fssmDevice);
  175. X            WriteLn;
  176. X
  177. X            (* and the host devices unit *)
  178. X            Write(CHR(9));
  179. X            WriteString("Unit         : ");
  180. X            WriteLongCard(fssm^.fssmUnit,8);
  181. X            WriteLn;
  182. X            
  183. X            (* now probe the enivroment space *)
  184. X           
  185. X            FOR p:=0 TO SHORT(dosenvptr^[0]) DO
  186. X                Write(CHR(9));
  187. X                
  188. X                CASE p OF
  189. X                   0:  WriteString("env size     : "); |
  190. X                   1:  WriteString("block size   : "); |
  191. X                   2:  WriteString("SecOrg       : "); |
  192. X                   3:  WriteString("Num Heads    : "); |
  193. X                   4:  WriteString("Sec / Blk    : "); |
  194. X                   5:  WriteString("blks / track : "); |
  195. X                   6:  WriteString("reserved     : "); |
  196. X                   7:  WriteString("prefac       : "); |
  197. X                   8:  WriteString("Interleave   : "); |
  198. X                   9:  WriteString("Low Cyl      : "); |
  199. X                  10:  WriteString("High Cyl     : "); |
  200. X                  11:  WriteString("Buffers      : "); |
  201. X                  12:  WriteString("bufmemtype   : "); |
  202. X                  13:  WriteString("Maxtransfer  : "); |
  203. X                  14:  WriteString("Mask         : "); |
  204. X                  15:  WriteString("bootpri      : "); |
  205. X                  16:  WriteString("DOStype      : ");
  206. X                END;
  207. X         
  208. X                IF p<>16 THEN
  209. X                   WriteLongCard(dosenvptr^[p],8);
  210. X                ELSE
  211. X                   WriteLongHex(dosenvptr^[p],16);
  212. X                END;
  213. X         
  214. X                WriteLn;
  215. X            END;         
  216. X         END;
  217. X         
  218. X         (* display the taskpri of the device handler *)
  219. X         Write(CHR(9));
  220. X         WriteString("Pri          : ");
  221. X         WriteLongInt(devnodeptr^.dnPriority,8);
  222. X         WriteLn;
  223. X
  224. X         (* and the amunt of stack for that task *)
  225. X         Write(CHR(9));
  226. X         WriteString("Stack        : ");
  227. X         WriteLongCard(devnodeptr^.dnStackSize,8);
  228. X         WriteLn;
  229. X         
  230. X         (* print out the name of the handler *)
  231. X         Write(CHR(9));
  232. X         WriteString("Handler      : ");
  233. X         cptr:=PtrFromBPTR(devnodeptr^.dnHandler);
  234. X         IF cptr^ = CHR(0) THEN
  235. X            WriteString(" default dos handler");
  236. X         ELSE
  237. X            WriteBSTR(devnodeptr^.dnHandler);
  238. X         END;
  239. X         WriteLn;
  240. X               
  241. X      END; (* device case *)
  242. X
  243. X      (* I don't bother extracting any info from VOLUMES|DIRS
  244. X         there's not much of interest in there anyway
  245. X      *)
  246. X    
  247. X      WriteLn;
  248. X      
  249. X      devlistptr:=PtrFromBPTR(devlistptr^.dlNext); 
  250. X      (* scan on down devlist *)
  251. XEND;
  252. X
  253. X
  254. XCloseLibrary(DOSBase);
  255. X
  256. XEND lister.
  257. END_OF_FILE
  258. if test 6787 -ne `wc -c <'listdevs.mod'`; then
  259.     echo shar: \"'listdevs.mod'\" unpacked with wrong size!
  260. fi
  261. # end of 'listdevs.mod'
  262. fi
  263. if test -f 'listdevs.uu' -a "${1}" != "-c" ; then 
  264.   echo shar: Will not clobber existing file \"'listdevs.uu'\"
  265. else
  266. echo shar: Extracting \"'listdevs.uu'\" \(10702 characters\)
  267. sed "s/^X//" >'listdevs.uu' <<'END_OF_FILE'
  268. Xbegin 666 listdevs
  269. XM```#\P`````````#``````````(```8B````=`````````/I```&(D[Y```0"
  270. XMX"!?D)"PJ``$8@SC@-"H``C0\`@`3M#1Z``(68A.T"(`<`9.1TYU3E;_Z"H`W
  271. XM>`G:A#U%__XJ#E"%+47_Z$#N__@M3?_T+5;_\$YH+4C_[`QN``?__F<(#&X`%
  272. XM"/_^9A0M;@`2__HJ+O_H4(4M1?_H3OH`0@QN``___F8,3F@M:``(__I.^@`N6
  273. XM#&X`$/_^9@Q"KO_Z0J[_\$[Z`!H,;@`)__YE"DYH+5#_^D[Z``@M;@`*__I)U
  274. XM^0```!@XKO_^0BP``BEN__H`!#EN__@`""EN__0`"BEN__``#BEN_^P`$BENQ
  275. XM__``%AE\``$`&BYN_^@@.0```!0O0``"/KP``"Q63FA9B$Y@3G-.7DYU2?D`)
  276. XM``!4*@PB17``+'@`!$ZN_=@J`"Q%.CD````8!D4!]4C%(@5.KO]P($]!Z/^`W
  277. XMD<"Q[0`$8@9R`W`&3D=.=4J?+T[__$YN+2\``CT7+2___$CF__PB42".+$E,/
  278. XMWC__+U[__#Z>+UX``DYF+&___$YS2I\O3O_\3FXM+P`"/1<M+__\2.;__")1<
  279. XM((Y'^@`J+0L]/$ZY/3PG`#T\1OPDCBQ)3-X__R]>__P^GB]>``).9BQO__Q.&
  280. XM<R].__Q.;BTO``8]+P`$+2___$CF__P@7R)H`"0BCBQ(3-X__R]>__P^GB]>C
  281. XM``).9BQO__Q.<T;\)P`N'PP'`"=F!DZY```"4`P'`"9F!DZY```!4`P'`"5F=
  282. XM!DZY```!@@P'``IF"'#X3KD````L#`<`"V8(</=.N0```"PP!T1`4D!.N0``P
  283. XM`"Q*GU4`9@@"5_C_@U=.<U,`9@0^@4YS4P!F!D;\(`!.<U,`9@1.<4YS4P!F8
  284. XM"B`!3KD````L3G-.5@``2.=X`"(N``PD+@`(M+P``/__8AY"0X+":`XX`4)!)
  285. XM2$&"PC8!,@2"PDA#-@%"04A!8!Y"@S8!2$-"04A!.#P`#^.+XY&R@F4$DH)2%
  286. XM0U',__(M0P`,+4$`"$S?`!Y.7DYU3E8``$CG_P!,[@#P``A(1#8$2$:]0UOG5
  287. XM-`0P/'_PQ$!G``$.-@;&0&<``0;60@1#/_!C``#\:P``_G`/R$`(Q``$S$`(^
  288. XMQ@`$=``_`S`$P,9(0#($PL<V!$A&QL;0@S8$2$?&QTA!TD-"0TA#T8-(1#8$&
  289. XMQL;20TA!0D-(0]&#-@1(1L;&T(,V!,;'TH/1@C8$2$?(QT)$2$32A-&"-@7&X
  290. XMQM*#T8(V!4A&QL9"0TA#TH/1@DA%-@7&QM*#T8)(1LS%2$'21DA!0D9(1M&&M
  291. XM2$?*QT)%2$72A=&"4('1@C8?>`1Z&0L`9P921`9#`!`4`.BZ0@+HJ.BI@H);'
  292. XM!0L`9@S4@M.!T8`$0P`*8R1*0VLH2$`"0``/@$-(0$H?9P1V'P?`2.X``P`02
  293. XM3-\`_TY>3G543W``<@!@ZG`%3KD````D3E8``$CG_P!,[@#P``A(1#($`D%_0
  294. XM\&<``(Y(1C`&`D!_\&<``'"0009`/_!K``!X,@:Y05OG`D8`#PC&``0"1``/,
  295. XM",0`!$A&2$1R'G8`82(D`W(7=@!A%G()XZO5@FM.!$``$&L``"S6@]6"8$#>"
  296. XMA]V&O(1<R?_X`\.>A9V$6\G_[FH,WH7=A`.#2D%=R?_@3G54CW0`=@!([@`,#
  297. XM`!!,WP#_3EY.=7`%3KD````D?``&@P``"`#5AF0*XI+BDP9``!!KXG(`,@)^/
  298. XM"^ZJ[JONN4(!AH%(0@)"``^$0$A"2A]GMG`?`<)@L$Y6``!(Y^``<``B+@`([
  299. XM9T@T/$'@2$$P`68*2$$P`7(`!$(!`$)!#$``_V(,X8CAF8`!0@$$0@"`2D!K[
  300. XM"@1"`!#2@=%`:O;KB.N9@`%"`4A``D``#X!"2$!([@`#``A,WP`'3EY.=4YUG
  301. XM3E8``$CGX``@+@`(XY@D``*``/___P*"_P```&82<`!R`$CN``,`"$S?``=.%
  302. XM7DYUYHKBB.*2!H(X````(@#FB.:9`H%P````@()@UDYQ3G%.<2H`(\4````$\
  303. XM*@@CQ0`````J#R/%````#"`O``0J`"/%````""HY````#)JY````"%"%(\4`[
  304. XM``!02?D```:01_D```!4>@L6W%?-__PC_````1`````4+'@`!")\`````$ZN8
  305. XM_MHJ`"/%````$"/Y````$````$PJ/````?XH>0```$PI10`R+'@`!'`'3J[^]
  306. XMJG`%3J[^JG`&3J[^JD*G0J="IR)Y````4"\)0J<J3Y[\`"2=SF$*+GD````,D
  307. XM<`!.=4[Y```&HF1O<RYL:6)R87)Y`$[Y```%Q$*Y````8D[Y```(@$Y6```O:
  308. XM#B)N``@L>``$3J[^8BQ?3EY.=4Y6```O#BAN``PJ#")%("X`""QX``1.KOW83
  309. XM+%\J`"U%`!).7DYU3E8``"HN``CEA2U%``Q.7DYU3E;_X@QN`"``$&44#&X`E
  310. XM`@`490P,;@`D`!1B!'H!8`)Z`"AN``@8A2AN``A*%&<"8`1.^@#4>@`Z+@`4,
  311. XM+47_XD)N_^@O+@`6+R[_XDZY```"ABZ?*A\]1?_F#&X`"O_F9!@Z+O_F!D4`D
  312. XM,#@N_^A)[O_L&85``$[Z`!HZ+O_F!$4`"@9%`$$X+O_H2>[_[!F%0`!2;O_H_
  313. XM+RX`%B\N_^).N0```H98CRU?`!9*K@`69P)@DDHN`!)G$CHN_^A)[O_L&;P`[
  314. XM+5``3OH`!E-N_^@];O_H_^HZ+O_H2>[_[#@N_^J8;O_H)FX`#!>T4`!``%-N7
  315. XM_^A*;O_H;0)@VCHN_^I212AN``Q"-%``3EY.=4Y6__Y9CR\\.Z/7"DZY```%M
  316. XM>$GY````Y"C?*-\]?``#__XZ+O_^4T7G14GY````U"\T4`0O-%``+SD```%PG
  317. XM+SD```%L3KD```0H4(\Z+O_^YT5)^0```-1)]%``*-\HWU)N__X,;@`1__YF4
  318. XMMDY>3G5.^0``!IQ.5@``68]Z`"\%3KD```402?D```%<*-\HWUF/>@$O!4ZYO
  319. XM```%$$GY```!9"C?*-]9CWH*+P5.N0``!1!)^0```6PHWRC?80#_0EF/>@HO`
  320. XM!4ZY```%$$GY````G"C?*-]9CWID+P5.N0``!1!)^0```*0HWRC?68\J/```E
  321. XM)Q`O!4ZY```%$$GY````K"C?*-\O.0```+`O.0```*PO.0```+`O.0```*Q.I
  322. XMN0```NI0CTGY````M"C?*-\O.0```+@O.0```+0O.0```+@O.0```+1.N0``'
  323. XM`NI0CTGY````O"C?*-\O.0```,`O.0```+PO.0```,`O.0```+Q.N0```NI0R
  324. XMCTGY````Q"C?*-\O.0```,@O.0```,0O.0```,@O.0```,1.N0```NI0CTGYO
  325. XM````S"C?*-\O.0```-`O.0```,PO.0```-`O.0```,Q.N0```NI0CTGY````&
  326. XMU"C?*-\O.0```-@O.0```-0O.0```-@O.0```-1.N0```NI0CTGY````W"C?1
  327. XM*-\C_$$@``````!F(_P[H]<*````?B/\0L@``````&HC_#H#$F\```""(_Q&@
  328. XM'$``````;B/\.%&W%P```(8C_$R^O"````!R(_PVI\6L````BB/\6@X;R@``@
  329. XM`'8C_#4&-[T```".(_QTG<6N````>B/\,U:_E0```))"N0```)9.7D[Y```,-
  330. XM]DY6```O#BQY````8DZN_\HL7RH`+44`"$Y>3G5.5@``+PXL>0```&).KO]\@
  331. XM+%\J`"U%``A.7DYU3E8``"\.(BX`""QY````8DZN_R@L7RH`2H56Q40%'44`+
  332. XM#$Y>3G5.5@``+PXL>0```&).KO_$+%\J`"U%``A.7DYU3E8``"\.(BX`$"0N3
  333. XM``PF+@`(+'D```!B3J[_OBQ?*@`M10`43EY.=4Y6```O#B(N`!`D+@`,)BX`%
  334. XM""QY````8DZN_]`L7RH`+44`%$Y>3G5.5O_\*&X`#$JN``AF"CE\__\`!D[ZV
  335. XM`'8HK@`(+PQ5CR\N``A.N0``"LI8CQH?*%]*!6<(0BP`!$[Z`$XO#%F/+RX`@
  336. XM"$*G>@$O!4ZY```+#$_O``PJ'RA?+47__"\,68\O+@`(0J=Z_R\%3KD```L,!
  337. XM3^\`#"H?*%\I10`(2JP`"%?%1`4910`$0FP`!DY>3G5.5O_\*&X`"DJ48U0O[
  338. XM#%F/+Q1'[@`(*@LO!7H!+P5.N0``"S1/[P`,*A\H7RU%__QZ`;JN__QG'"\,U
  339. XM68].N0``"JXJ'RA?.44`!AE\``$`!$[Z``I";``&0BP`!$[Z``@Y?/__``9.D
  340. XM7DYU3E;_^BAN``Y*E&,"8`1.^@"`0F[_^CHN__JZ;@`,8A0Z+O_Z)FX`"$HS_
  341. XM4`!G!E)N__I@XB\,68\O%"9N``@J"R\%>@`Z+O_Z+P5.N0``"S1/[P`,*A\HS
  342. XM7RU%__QZ`#HN__JZKO_\9QPO#%F/3KD```JN*A\H7SE%``89?``!``1.^@`*O
  343. XM0FP`!D(L``1.^@`(.7S__P`&3EY.=4[Y```(>DY6``!*N0```&)F'EF//SP`7
  344. XM"DAY```-*$*G3KD```;&3^\`"B/?````8DY>3OD```U^9&]S+FQI8G)A<GD`/
  345. XM3E8``$(Y```!=$Y>3G5.5O_^0F[__CHN__ZZ;@`,8AHZ+O_^*&X`"!@T4`"X]
  346. XM.0```71G!E)N__Y@W#UN__X`#DY>3G5.^0``#/!.5@``80#_L$Y>3OD```Z._
  347. XM3E8``$AY```!AA\N``A.N0``"^Q<CTY>3G5.5@``'SP`"F$`_]Q4CTY>3G5.^
  348. XM5@``2'D```&&/RX`#"AN``A(5$ZY```,5D_O``I*>0```8Q7Q40%$\4```%V&
  349. XM3EY.=4Y6_ZQ5CS\N``XH;@`*2%1.N0``#4)<CSHN``B:7SU%__X,;@!/__YOW
  350. XM!CU\`$___D)N__PZ+O_^4T4_!3`N__RP5V\$3OH`'CHN__Q)[O^L&;P`(%``Z
  351. XM,"[__+!7;`92;O_\8.14CPQN`$___F<,.B[__DGN_ZQ"-%``/SP`3TAN_ZQA&
  352. XM`/]*7(\_+@`.*&X`"DA480#_.ER/3EY.=4[Y```->$Y6``!*N0```&)F'EF/@
  353. XM/SP`"DAY```/(D*G3KD```;&3^\`"B/?````8D(Y```!>$AY```!>EF/3KD`^
  354. XM``J23KD```M<4(])^0```7I'^0```9(FW";<)MQ(>0```899CTZY```*\$ZYW
  355. XM```+7%"/2?D```&&1_D```&>)MPFW";<3EY.^0``$.9I;CX@``!O=70^(`!DL
  356. XM;W,N;&EB<F%R>0!.5O_^0F[__CHN__ZZ;@`,8A0Z+O_^*&X`"$HT4`!G!E)N@
  357. XM__Y@XCUN__X`#DY>3G5.5O_6*BX`"DJ%;`)$A2\%/SP`"DJN``I=Q40%'P4_.
  358. XM/``G2&[_V$AN_]=.N0``!OY/[P`2/SP`)TAN_]@_+@`(3KD```WL4(\3^0``F
  359. XM`78```&J3EY.=4Y6_]8O+@`*/SP`"D(G/SP`)TAN_]A(;O_73KD```;^3^\`C
  360. XM$C\\`"=(;O_8/RX`"$ZY```-[%"/$_D```%V```!JDY>3G5.5O_4+RX`"C\\+
  361. XM`!!")S\\`"=(;O_82&[_U4ZY```&_D_O`!)5CS\\`"=(;O_880#_!%R//5__*
  362. XMUCHN_]9)[O_8&;P`2%``.B[_UE)%2>[_V$(T4``_/``G2&[_V#\N``A.N0``A
  363. XM#>Q0CQ/Y```!=@```:I.7DYU<`9.N0```3I.5O_Z68\O+@`(3KD```;L6(\MD
  364. XM7__\*&[__`P4``%E1#U\``'_^BAN__QZ`!H4/P4P+O_ZL%=C!$[Z`"@H;O_\K
  365. XM.B[_^DN\`/\?-%``3KD```V.5(\P+O_ZL%=D!E)N__I@VE2/3EY.=4[Y```.Q
  366. XMB$Y6``!9CS\\``I(>0``%H9"ITZY```&QD_O``HCWP```&(_/``?2'D``!:2A
  367. XM3KD```VZ7(].N0``#:@C^0```&(```&L68\H>0```:PH;``B+RP`&$ZY```&,
  368. XM[%B/(]\```&P68\H>0```;`O+``$3KD```;L6(\CWP```;1*N0```;1G`F`$[
  369. XM3OH%`C\\``M(>0``%K1.N0``#;I<CRAY```!M"\L`"A.N0``$'!8CTZY```-T
  370. XMJ!\\``E.N0``#8Y4CRAY```!M$JL``1F'#\\`!)(>0``%L).N0``#;I<CTZY)
  371. XM```-J$[Z`&XH>0```;1Z`;JL``1F'#\\`!)(>0``%M9.N0``#;I<CTZY```-O
  372. XMJ$[Z`$0H>0```;1Z`KJL``1F'#\\`!)(>0``%NI.N0``#;I<CTZY```-J$[Z]
  373. XM`!H_/``22'D``!;^3KD```VZ7(].N0``#:@H>0```;1*K``$9@)@!$[Z!`0C`
  374. XM^0```;0```&X68\H>0```;@O+``<3KD```;L6(\CWP```;Q9CRAY```!O"\L@
  375. XM``A.N0``!NQ8CR/?```!P$JY```!O&<.*'D```'`>A"ZE&4"8`1.^@+('SP`2
  376. XM"4ZY```-CE2//SP`#DAY```7$DZY```-NER/*'D```&\+RP`!$ZY```0<%B/E
  377. XM3KD```VH'SP`"4ZY```-CE2//SP`#DAY```7(DZY```-NER/*'D```&\+Q0_!
  378. XM/``(3KD```^T7(].N0``#:A">0```<PH>0```<`J%#\%,#D```',L%=C!$[Z-
  379. XM`CH?/``)3KD```V.5(]Z`#HY```!S"`%3KD````&`````````!````&&/SP`C
  380. XM#DAY```7,DZY```-NER/3OH!D#\\``Y(>0``%T).N0``#;I<CT[Z`7H_/``.2
  381. XM2'D``!=23KD```VZ7(].^@%D/SP`#DAY```78DZY```-NER/3OH!3C\\``Y(T
  382. XM>0``%W).N0``#;I<CT[Z`3@_/``.2'D``!>"3KD```VZ7(].^@$B/SP`#DAY-
  383. XM```7DDZY```-NER/3OH!##\\``Y(>0``%Z).N0``#;I<CT[Z`/8_/``.2'D`[
  384. XM`!>R3KD```VZ7(].^@#@/SP`#DAY```7PDZY```-NER/3OH`RC\\``Y(>0``B
  385. XM%]).N0``#;I<CT[Z`+0_/``.2'D``!?B3KD```VZ7(].^@">/SP`#DAY```7A
  386. XM\DZY```-NER/3OH`B#\\``Y(>0``&`).N0``#;I<CT[Z`'(_/``.2'D``!@2&
  387. XM3KD```VZ7(].^@!</SP`#DAY```8(DZY```-NER/3OH`1C\\``Y(>0``&#).*
  388. XMN0``#;I<CT[Z`#!.^@`D``P`(@`X`$X`9`!Z`)``I@"\`-(`Z`#^`10!*@%`,
  389. XM`58!;'`"3KD````D#'D`$````<QG)BAY```!P#HY```!S$N\`/_E12\T4``_4
  390. XM/``(3KD```^T7(].^@`D*'D```'`.CD```',2[P`_^5%+S10`#\\`!!.N0``\
  391. XM#_I<CTZY```-J#`Y```!S+!79`I2>0```<Q@`/W*5(\?/``)3KD```V.5(\_E
  392. XM/``.2'D``!A"3KD```VZ7(\H>0```;@O+``8/SP`"$ZY```/7ER/3KD```VH)
  393. XM'SP`"4ZY```-CE2//SP`#DAY```84DZY```-NER/*'D```&X+RP`%#\\``A.P
  394. XMN0``#[1<CTZY```-J!\\``E.N0``#8Y4CS\\``Y(>0``&&).N0``#;I<CUF/Q
  395. XM*'D```&X+RP`$$ZY```&[%B/(]\```'(*'D```'(2A1F%C\\`!-(>0``&').;
  396. XMN0``#;I<CT[Z`!0H>0```;@O+``03KD``!!P6(].N0``#:A.N0``#:A9CRAY[
  397. XM```!M"\43KD```;L6(\CWP```;1@`/KT+SD```!B3KD```:N6(].7DYU````X
  398. XM`&1O<RYL:6)R87)Y`&QI<W1D979S('8Q+C(@0GD@2F]H;B!$879I<R`V+SDP-
  399. XM``!N;V1E(&YA;64@.B```%1Y<&4@("`@("`@("`Z($1%5B``5'EP92`@("`@^
  400. XM("`@(#H@1$E2(`!4>7!E("`@("`@("`@.B!63TP@`%1Y<&4@("`@("`@("`Z"
  401. XM(#\_/R``1&5V:6-E("`@("`@(#H@`%5N:70@("`@("`@("`Z(`!E;G8@<VEZ@
  402. XM92`@("`@.B``8FQO8VL@<VEZ92`@(#H@`%-E8T]R9R`@("`@("`Z(`!.=6T@,
  403. XM2&5A9',@("`@.B``4V5C("\@0FQK("`@(#H@`&)L:W,@+R!T<F%C:R`Z(`!R8
  404. XM97-E<G9E9"`@("`@.B``<')E9F%C("`@("`@(#H@`$EN=&5R;&5A=F4@("`Z\
  405. XM(`!,;W<@0WEL("`@("`@.B``2&EG:"!#>6P@("`@(#H@`$)U9F9E<G,@("`@#
  406. XM("`Z(`!B=69M96UT>7!E("`@.B``36%X=')A;G-F97(@(#H@`$UA<VL@("`@#
  407. XM("`@("`Z(`!B;V]T<')I("`@("`@.B``1$]3='EP92`@("`@(#H@`%!R:2`@`
  408. XM("`@("`@("`Z(`!3=&%C:R`@("`@("`@.B``2&%N9&QE<B`@("`@(#H@`"!D&
  409. XM969A=6QT(&1O<R!H86YD;&5R``````/L````I0`````````"```"#````A@`C
  410. XM``(D```",@```D````),```"@```!"0```32```&!```!A@```9"```&C```L
  411. XM!IX```:J```'3```!YX```@8```(4```"'P```B,```(H@``"+@```C2```(H
  412. XMZ```"0(```DJ```)5```"7X```FH```)T@``"?P```J.```+@@``"Z@```O(&
  413. XM```,#```#"H```RB```,Q```#/(```T*```-$@``#20```UZ```-B@``#9X`Z
  414. XM``W0```-_@``#HH```ZB```.J@``#L@```[.```.\```#O8```\2```/B@``6
  415. XM#Z````_0```/Y@``$!8``!!<```0=```$(0``!#&```0X@``$/(``!#Z```12
  416. XM#@``$10``!$<```1/```$58``!%V```1?```$8X``!&6```1H```$;@``!&^W
  417. XM```1Q@``$>(``!'H```1\```$@P``!(2```2&@``$B@``!(N```2-@``$F0`J
  418. XM`!)^```2J@``$K8``!*\```2S@``$M8``!+@```2[```$O(``!,&```3#@``8
  419. XM$S8``!-(```37@``$V0``!-T```3>@``$XH``!.0```3H```$Z8``!.V```3H
  420. XMO```$\P``!/2```3X@``$^@``!/X```3_@``%`X``!04```4)```%"H``!0Z:
  421. XM```40```%%```!16```49@``%&P``!1\```4@@``%)(``!28```4J```%*X`2
  422. XM`!2^```4Q```%/@``!4B```52```%5```!5P```5?```%8(``!68```5H```^
  423. XM%:H``!6V```5O```%=(``!7:```5Y```%?```!7V```6"@``%B8``!8L```6N
  424. XM0@``%DH``!90```68```%G@```"2`````0```+H```#V```!$@```2H```7.@
  425. XM```%U@``!=X```7J```%\```!?8```7^```&"@``!AP```8R```&.```!CP`*
  426. XM``9(```&;@``!H(```:D```('@``"#8```A$```(2@``"%X```B2```(J```F
  427. XM"+X```C8```([@``"0@```D2```)&```"1X```DD```),@``"3P```E"```)1
  428. XM2```"4X```E<```)9@``"6P```ER```)>```"88```F0```)E@``"9P```FB[
  429. XM```)L```";H```G````)Q@``"<P```G:```)Y```">H```GP```)]@``"@0`R
  430. XM``H2```*'```"B8```HP```*.@``"D0```I.```*6```"F(```IL```*=@``:
  431. XM"H````J&```*F@``"K8```K6```*^```"R````M(```,_```#1P```TZ```-C
  432. XM8@``#90```W````-V@``#>0```Z4```.M```#KH```[````.U@``#MP```[HF
  433. XM```._@``#P0```^H```/K```#^X```_R```09```$&@``!$$```1(@``$28`Z
  434. XM`!$N```11```$4P``!%>```19```$80``!&H```1T```$?H``!(\```23@``]
  435. XM$E(``!):```2;```$G0``!*&```2C```$I0``!+$```2^@``$Q0``!,:```3Y
  436. XM)```$T```!4````5"```%0X``!4N```5-```%58``!5@```5B@``%<0``!8`&
  437. XM```6$@``%A@``!8X```66```%F@``!9R`````````_(```/K````=````_(`D
  438. X+``/J`````````_(X:
  439. X``
  440. Xend
  441. Xsize 7616
  442. END_OF_FILE
  443. if test 10702 -ne `wc -c <'listdevs.uu'`; then
  444.     echo shar: \"'listdevs.uu'\" unpacked with wrong size!
  445. fi
  446. # end of 'listdevs.uu'
  447. fi
  448. if test -f 'zapdh0.doc' -a "${1}" != "-c" ; then 
  449.   echo shar: Will not clobber existing file \"'zapdh0.doc'\"
  450. else
  451. echo shar: Extracting \"'zapdh0.doc'\" \(8428 characters\)
  452. sed "s/^X//" >'zapdh0.doc' <<'END_OF_FILE'
  453. XZapDH0
  454. X------
  455. XBy John Davis, 
  456. X
  457. XVersion 1   October 1989
  458. XVersion 1.1 April 1990
  459. XVersion 1.2 24 June  1990
  460. XVersion 1.3 26 June  1990 ( 1.2 didn't last long did it :-)
  461. X
  462. XWhat it does
  463. X------------
  464. XAll  you  2090  owners  ....   ever  get _really_ annoyed with that forced
  465. XOldFileSystem  DH0 partition?  It's bad enough that you hvae to waste 400k
  466. Xof  disk  space with the OFS partition, but what is really inconvenient is
  467. Xthat  you can't cancel the device ( <assign dh0:  remove> sends you off to
  468. Xmeet  the guru ), and therefore means you can't assign DH0:  to be the FFS
  469. Xpartition.
  470. X
  471. XThis  in  turn  means that all those _nice_ programs with install programs
  472. Xthat  want  to  install to DH0, or those equally _nice_ programs that give
  473. Xyou  file requester gadgets only for DH0 aren't much fun at all ( okay ...
  474. Xcall  me lazy, but newzapping three zillion programs so as DH0->FH0 is not
  475. Xmy  idea  of  fun  ...   at this point I should say a big thank you to all
  476. X_real_  programmers  whose  filereq's  know  what the _current_ dir is and
  477. Xstart  there, or even better those that know how to scan a device list for
  478. Xavailable  devices  <  not  hard  ...   see  the included example code for
  479. XListDevs > )
  480. X
  481. XWell this program is just for you.  What it does is munge it's way through
  482. Xthe  DOS  device list, looking for that 'orrible DH0 node .  When it finds
  483. Xit, it alters the DeviceNodeName so as it's name is now ZH0.  You are then
  484. Xfree to assign DH0:  onto your real main partition.
  485. X
  486. XOn  top  of  this,  if it detects that you have a df2:  floppy disk but no
  487. Xdf1:   it will create a 'clone' drive called df1:.  This is linked (arghhh
  488. X...   creeping unix terminology :-)) to df2:, and helps with programs that
  489. Xonly have gadgets for df0:  and df1:, or if you (like me) have got used to
  490. Xtyping 'df1:' when referring to the second drive (old a500 traits die hard
  491. Xit seems)
  492. X
  493. XUsage
  494. X-----
  495. X
  496. XPretty    simple   really,   just   chuck   ZAPDh0   somewhere   in   your
  497. Xstartup-sequence.
  498. X
  499. XIt  is  _probably_ safer if you do it once you've assigned everything over
  500. Xto the FFS partition, but it seems that it's pretty safe to put just about
  501. Xanywhere  (as  any  existing dos locks to dh0:blah will still point to the
  502. X_old_  DH0:   ...  it's just any new references that will get the assigned
  503. XDH0).
  504. X
  505. Xeg .. in your startup-sequence
  506. X
  507. X     ZAPDh0
  508. X     assign DH0: fh0:
  509. X
  510. XFrom  now  on  all references to DH0:  will refer to FH0:.  If you want to
  511. Xacces the OFS partition, you still can (unlike if you use assigndev), it's
  512. Xjust  now called ZH0:  ( and you can still access it via workbench).  Plus
  513. X(  if  you  had a df2:  but no df1:  ) you'll find you've grown a df1:  as
  514. Xwell.
  515. X
  516. XIncidentally,  should you want to STOP the floppy rename ( due to problems
  517. Xor  if  you  just  don't like the idea ) then just add these lines to your
  518. Xstartup-sequence instead of the above :
  519. X    ASSIGN DF1: sys:
  520. X    ZapDH0:
  521. X    ASSIGN DF1:
  522. X    ASSIGN DH0: fh0:
  523. X
  524. X( I don't check to see if an existing DF1 is really a device or just a 
  525. Xdir, so the assigned df1: will fool me into not touching the floppies )
  526. X
  527. XWarning
  528. X-------
  529. X
  530. XThis  program  is what CBM tech support would probably describe as 'wildly
  531. Xillegal'  ...   I  access structures in a manner I've got no right to.  As
  532. Xsuch  I cannot guarantee it will work on any given setup, nor that it will
  533. Xwork  in  future  releases  of  the  OS.   I have tested it on 2000's with
  534. X2090's,on  500's with A590s and on C-Ltd drives, and it's worked ok on all
  535. Xof them.
  536. X
  537. XBUT  -  there  is now warranty implied or express on this package!!  If it
  538. Xcauses your hard disk to explode, killing your cat and causing you to have
  539. Xa  nervous  breakdown,  it is NOT MY FAULT.  However, if you do experience
  540. Xany  strange  side  effects  or  any  other  problems  with or due to this
  541. Xprogram, get in touch so as I can see about remedying them.
  542. X
  543. X
  544. X
  545. XRevision History and Tech Notes
  546. X-------------------------------
  547. X
  548. Xv 1.3 
  549. X-----
  550. X
  551. XTime  for  a total rethink of how the df2:  floppy is renamed to be df1:!!
  552. XPlus a general code cleanup ( was starting to look a tad loosed in there).
  553. X
  554. XPrevious versions just altered the name field of the df1:  devicelist node
  555. Xin  place,  this worked great for the 99% of the programs that went by the
  556. Xrules for working out what the host device was ( by host device I mean the
  557. Xunderlying block structured device the filesystem level device sits on e.g
  558. Xfor  df0:   the host device is trackdisk.device unit 0), but it turned out
  559. Xthat  some  programs  were  wrongly  assuming that there would ALWAYS be a
  560. Xcorrespondence  between the devname and the trackdisk devce unit acting as
  561. Xhost  (  that  is df1:  is unit 1, df2:  unit 2 etc ...  which is normally
  562. Xtrue, but assuming this is NOT an officially supported practice ).
  563. X
  564. X !  Included in this archive is ListDevs, a small example program that
  565. X !  shows how to LEGALLY work out what the host device for a given dos
  566. X !  device is, plus it shows how to extract a lot of other info on the
  567. X !  host-dev  -  based  in  part  on  code posted to UseNet by Patrick
  568. X !  Horgan.
  569. X
  570. X !  You  should NEVER assume a connection between device name and host
  571. X !  device  and/or  it's  parameters  ..   cos sooner or later CBM are
  572. X !  likely to change them ( to support higher densities or the like ).
  573. X !  REMEMBER  ..   if they don't state it in the RKM, it's NOT safe to
  574. X !  assume it!!!!
  575. X
  576. XThis  release gets around this problem by instead 'cloning' the devicelist
  577. Xnode  for  df2:  back into the devicelist as df1:.  This effectively makes
  578. Xdf1:  an alias for df2:, and still costs <100 bytes of memory.
  579. XThis allows ill-behaved programs (Virusx4 and the ARP install were notable
  580. Xoffenders)  to work ( like why is it that two of my favourite programs, by
  581. Xsome  of  the programmers I respect the most, have to be the one's that do
  582. Xthings illegally :-( :-) ).
  583. X
  584. XI've  tested the cloned drives fairly extensively, and everything seems to
  585. Xwork  as  it  should  with  them.   This  includes  correct operation thru
  586. XWorkBench, and with format and diskcopy ( format df1:  puts a lock on BOTH
  587. Xdf1:   and  df2:, diskcopy df1:  to df2:  is the same as diskcopy df1:  to
  588. Xdf1:  in that it will prompt you to do disk-swaps ). 
  589. XHowever,  the  df2:   clone/rename  is  still  basically illegal operation
  590. X(a.k.a  a  neat  hack  :-),  and it is possible some programs may not like
  591. Xhaving a drive clone done.  Hence, if anyone experiences any anomalies due
  592. Xto  using  Zapdh0_1.3, could they please contact me ( stating what program
  593. Xhad difficulties ).
  594. X
  595. Xv 1.2 
  596. X-----
  597. X
  598. XMy  conscience got the better of me, the floppy rename is now handled in a
  599. Xsafer  manner  (unlike  1.1).   ZapDH0  now  first looks to see if there's
  600. Xalready  a  DF1  in  the  system  ( an internal 3.5 floppy ).  If there is
  601. Xalready  a  df1:   it  leaves  the floppies alone (otherwise if you had an
  602. Xexternal  as  well  you'd  end up having two DF1:'s !!  having this happen
  603. Xwasn't much fun).  If it can't find a df1:, it looks to see if it can find
  604. Xa df2:  and renames it if possible.
  605. X
  606. Xv 1.1
  607. X-----
  608. X
  609. XNothing  mind-blowing  I'm  afraid ( boy, what I'd give to get rid of that
  610. Xslowfilesystem partition altogether, guess I'll just have to buy a 2091 ).
  611. X
  612. XAll  that's  changed  is  that ZapDH0's output is now cleaner, PLUS it now
  613. Xalso  renames  Df2:  to be df1:  (for people like me with one internal and
  614. Xone external floppy, but who are too used to df1:  being the second drive)
  615. X
  616. XIt still renames DH0 ( if found ) to be ZH0 (it simply traverses down the
  617. XDOS devicelist and changes the name field in devicelist node for dh0: ->
  618. Xzh0:  and for df2: -> df1:). To see exactly how this is done ( I smell
  619. XBPTRs :-) refer to the source code
  620. X
  621. X
  622. XLicence Agreement
  623. X-----------------
  624. X
  625. XThere  is  none  !!   ZapDH0  is  absolutely  100%  Public  Domain (and is
  626. Xdedicated  to  all  the  other  PD authors who help make the Amiga a great
  627. Xmachine).
  628. X
  629. XIf  this  program  makes  you  happy, and makes your life a little easier,
  630. Xthat's  good.   If  you  feel  obliged to thank me, then that's alright, I
  631. Xalways  enjoy  getting  letters  from fellow amiga users.  If it makes you
  632. Xunhappy  (  i.e.   it's got some bug I haven't found ), then also write to
  633. Xme.
  634. X
  635. XMy contact adress is .....
  636. X
  637. X   John Davis
  638. X   31 Clarence St
  639. X   Christchurch 2
  640. X   New Zealand
  641. X
  642. Xor you can find me on AmigaINFO BBS 
  643. X                      NZ +3-371-531 1200/2400 Baud 24hrs a day 
  644. X                      "home of the midnight coders"
  645. X
  646. Xor you can reach me via Internet/UseNet as CHEM194@canterbury.ac.nz
  647. X
  648. END_OF_FILE
  649. if test 8428 -ne `wc -c <'zapdh0.doc'`; then
  650.     echo shar: \"'zapdh0.doc'\" unpacked with wrong size!
  651. fi
  652. # end of 'zapdh0.doc'
  653. fi
  654. if test -f 'zapdh0.mod' -a "${1}" != "-c" ; then 
  655.   echo shar: Will not clobber existing file \"'zapdh0.mod'\"
  656. else
  657. echo shar: Extracting \"'zapdh0.mod'\" \(5239 characters\)
  658. sed "s/^X//" >'zapdh0.mod' <<'END_OF_FILE'
  659. XMODULE zapper;
  660. X
  661. X(* zap DH0 device node name     *)
  662. X(* by J Davis v1.3 26 6/90      *)
  663. X(* compiled using TDI m-2 3.01a *)
  664. X
  665. X
  666. X(*
  667. X  this is an attempt to get around the problem with 2090's where
  668. X  the first partition MUST be OFS and is called DH0. This is a real
  669. X  problem when you have a main FFS partition, on which you have all
  670. X  your programs etc, and programs that insist on using DH0
  671. X
  672. X   This program zaps the DH0 node name so as it is called ZH0.
  673. X   this is _extremely_ grungy, illegal etc ... but if it works
  674. X   then it is a good way to cure the problem.
  675. X*)
  676. X
  677. X(* v1.1 changes 
  678. X   cleaned up screen output
  679. X   now also renames df2: -> df1: for people like me who have
  680. X   one internal and one external floppy drive
  681. X*)
  682. X
  683. X(* v1.2 changes 
  684. X        only renames df2: -> df1: if no df1: present already
  685. X        gets around nastiness if you have 2 internals and an external :-)
  686. X*)
  687. X
  688. X(* v1.3 changes
  689. X        changed strategy on df2:, now clones the device node, links it
  690. X        back into the device list and renames the clone
  691. X*)
  692. X
  693. XFROM Memory          IMPORT AllocMem,MemReqSet,MemPublic,MemClear;
  694. XFROM DOSLibrary      IMPORT DOSName,DOSBase,BPTR,BSTR;
  695. XFROM DOSExtensions   IMPORT DosBaseRec,RootNode,DosInfo,DeviceList;
  696. XFROM AmigaUtils      IMPORT PtrFromBPTR,BPTRFromPtr;
  697. XFROM SYSTEM          IMPORT NULL;
  698. XFROM InOut           IMPORT WriteString,WriteLn;
  699. XFROM Libraries       IMPORT OpenLibrary,CloseLibrary;
  700. XFROM DOSLibrary      IMPORT DateStampRec;
  701. XFROM SYSTEM          IMPORT TSIZE;
  702. X
  703. XTYPE 
  704. X
  705. Xstring = ARRAY [0..255] OF CHAR;
  706. Xstrptr = POINTER TO string;
  707. X
  708. X
  709. XVAR
  710. X
  711. Xourdosbase : POINTER TO DosBaseRec; (* use this to access dosbase *)
  712. Xinfoptr    : POINTER TO DosInfo;    (* points to DOSinfo node     *)
  713. Xdevlistptr : POINTER TO DeviceList; (* points to current place is DOS devlist *)
  714. Xnameptr    : strptr;
  715. Xdf1present : BOOLEAN;               (* flag to indicate df1: is already mounted *)
  716. Xcloneptr   : POINTER TO DeviceList; (* for cloning operation *)
  717. X
  718. XBEGIN
  719. X
  720. XDOSBase:=OpenLibrary(DOSName,0);   (* open the dos lib *)
  721. X
  722. XWriteString("ZAPDh0 v1.3 By John Davis 6/90");
  723. XWriteLn;
  724. X
  725. Xourdosbase:=DOSBase;                              
  726. X(* get a usable pointer onto dosbase *)
  727. X
  728. Xinfoptr:=PtrFromBPTR(ourdosbase^.dlRoot^.rnInfo); 
  729. X(* get pointer dosinfo struct *)
  730. X
  731. Xdevlistptr:=PtrFromBPTR(infoptr^.diDevInfo);      
  732. X(* get a pointer to start of devlist *)
  733. X
  734. Xdf1present:=FALSE;                                
  735. X(* initially assume df1: is not present *)
  736. X
  737. XWHILE devlistptr<>NULL DO
  738. X      (* scan down device list checking as we go *)
  739. X          
  740. X      nameptr:=PtrFromBPTR(BPTR(devlistptr^.dlName));
  741. X      (* get pointer to nodename *)
  742. X
  743. X      IF (nameptr^[1]='D') AND (nameptr^[2]='H') AND (nameptr^[3]='0') THEN
  744. X         (* this is dh0 so zap it *)
  745. X         WriteString("   renamed DH0: to ZH0: ");
  746. X         WriteLn;
  747. X         nameptr^[1]:='Z'; (* we'll make it be called zh0: instead *)
  748. X      END;
  749. X      
  750. X      IF (nameptr^[1]='D') AND (nameptr^[2]='F') AND (nameptr^[3]='1') THEN
  751. X         (* found an existing df1 .. set flag so as not to try rename of df2 *)
  752. X         WriteString("   found existing DF1:, will not attempt to rename DF2:");
  753. X         WriteLn;
  754. X         df1present:=TRUE;
  755. X      END;
  756. X      
  757. X      devlistptr:=PtrFromBPTR(devlistptr^.dlNext); 
  758. X      (* scan on down devlist *)
  759. XEND;
  760. X
  761. XIF NOT df1present THEN 
  762. X   (* didn't find df1:, see if we can find df2 
  763. X      go back to start of devlist and re-scan
  764. X   *)
  765. X
  766. X   devlistptr:=PtrFromBPTR(infoptr^.diDevInfo); 
  767. X   (* get a pointer to the start of the devlist *)
  768. X
  769. X   WHILE devlistptr<>NULL DO
  770. X         (* scan down device list checking as we go *)
  771. X          
  772. X         nameptr:=PtrFromBPTR(BPTR(devlistptr^.dlName));
  773. X         
  774. X         IF (nameptr^[1]='D') AND (nameptr^[2]='F') AND (nameptr^[3]='2') THEN 
  775. X            (* this is df2:,so clone it *)
  776. X  
  777. X             WriteString("   found df2:, creating clone as df1:");
  778. X             WriteLn;
  779. X      
  780. X             cloneptr:=AllocMem(TSIZE(DeviceList),MemReqSet{MemPublic,MemClear});
  781. X            
  782. X             (* first link in our clone on the devlist *)
  783. X             cloneptr^.dlNext   :=devlistptr^.dlNext;
  784. X             devlistptr^.dlNext :=BPTRFromPtr(cloneptr);
  785. X            
  786. X             (* now copy the rest of the df2 struct over *)
  787. X             cloneptr^.dlType       :=devlistptr^.dlType;
  788. X             cloneptr^.dlTask       :=devlistptr^.dlTask;
  789. X             cloneptr^.dlLock       :=devlistptr^.dlLock;
  790. X             cloneptr^.dlVolumeDate :=devlistptr^.dlVolumeDate;
  791. X             cloneptr^.dlLockList   :=devlistptr^.dlLockList;
  792. X             cloneptr^.dlDiskType   :=devlistptr^.dlDiskType;
  793. X             cloneptr^.dlunused     :=devlistptr^.dlunused;
  794. X      
  795. X      
  796. X             (* now alter the name of the clone to be df1: *)
  797. X             nameptr:=AllocMem(4,MemReqSet{MemPublic,MemClear});
  798. X             cloneptr^.dlName:=BPTRFromPtr(nameptr);
  799. X      
  800. X             (* now put BSTR 'df1'into name *)
  801. X             nameptr^[0]:=CHR(3);
  802. X             nameptr^[1]:='D';
  803. X             nameptr^[2]:='F';
  804. X             nameptr^[3]:='1';
  805. X    
  806. X         END; (* found df2 if *)
  807. X       
  808. X         devlistptr:=PtrFromBPTR(devlistptr^.dlNext); 
  809. X         (* scan on down devlist *)
  810. X
  811. X    END; (* while *)
  812. X
  813. XEND; (* if not found df1 *)
  814. X
  815. XCloseLibrary(DOSBase);
  816. X
  817. XEND zapper.
  818. END_OF_FILE
  819. if test 5239 -ne `wc -c <'zapdh0.mod'`; then
  820.     echo shar: \"'zapdh0.mod'\" unpacked with wrong size!
  821. fi
  822. # end of 'zapdh0.mod'
  823. fi
  824. if test -f 'zapdh0.uu' -a "${1}" != "-c" ; then 
  825.   echo shar: Will not clobber existing file \"'zapdh0.uu'\"
  826. else
  827. echo shar: Extracting \"'zapdh0.uu'\" \(7554 characters\)
  828. sed "s/^X//" >'zapdh0.uu' <<'END_OF_FILE'
  829. Xbegin 666 zapdh0
  830. XM```#\P`````````#``````````(```0Z````<`````````/I```$.D[Y```,F
  831. XM["(`<`9.1TYU3E;_Z"H`>`G:A#U%__XJ#E"%+47_Z$#N__@M3?_T+5;_\$YH/
  832. XM+4C_[`QN``?__F<(#&X`"/_^9A0M;@`2__HJ+O_H4(4M1?_H3OH`0@QN``__K
  833. XM_F8,3F@M:``(__I.^@`N#&X`$/_^9@Q"KO_Z0J[_\$[Z`!H,;@`)__YE"DYHZ
  834. XM+5#_^D[Z``@M;@`*__I)^0```!@XKO_^0BP``BEN__H`!#EN__@`""EN__0`5
  835. XM"BEN__``#BEN_^P`$BEN__``%AE\``$`&BYN_^@@.0```!0O0``"/KP``"Q6;
  836. XM3FA9B$Y@3G-.7DYU2?D```!4*@PB17``+'@`!$ZN_=@J`"Q%.CD````8!D4!#
  837. XM]4C%(@5.KO]P2I\O3O_\3FXM+P`"/1<M+__\2.;__")1((XL24S>/_\O7O_\I
  838. XM/IXO7@`"3F8L;__\3G-*GR].__Q.;BTO``(]%RTO__Q(YO_\(E$@CD?Z`"HM^
  839. XM"ST\3KD]/"<`/3Q&_"2.+$E,WC__+U[__#Z>+UX``DYF+&___$YS+T[__$YNG
  840. XM+2\`!CTO``0M+__\2.;__"!?(F@`)"*.+$A,WC__+U[__#Z>+UX``DYF+&__,
  841. XM_$YS1OPG`"X?#`<`)V8&3KD```(<#`<`)F8&3KD```$<#`<`)68&3KD```%.!
  842. XM#`<`"F8(</A.N0````X,!P`+9@AP]TZY````#C`'1$!20$ZY````#DJ?50!F6
  843. XM"`)7^/^#5TYS4P!F!#Z!3G-3`&8&1OP@`$YS4P!F!$YQ3G-3`&8*(`%.N0``Z
  844. XM``Y.<TY6``!(Y_\`3.X`\``(2$0V!$A&O4-;YS0$,#Q_\,1`9P`!#C8&QD!G?
  845. XM``$&UD($0S_P8P``_&L``/YP#\A`",0`!,Q`",8`!'0`/P,P!,#&2$`R!,+')
  846. XM-@1(1L;&T(,V!$A'QL=(0=)#0D-(0]$0V!,;&TD-(04)#2$/1@S8$2$;&A
  847. XMQM"#-@3&Q]*#T8(V!$A'R,="1$A$TH31@C8%QL;2@]&"-@5(1L;&0D-(0]*#$
  848. XMT8)(138%QL;2@]&"2$;,Q4A!TD9(04)&2$;1ADA'RL="14A%TH71@E"!T8(V]
  849. XM'W@$>AD+`&<&4D0&0P`0%`#HND("Z*CHJ8*"6P4+`&8,U(+3@=&`!$,`"F,DD
  850. XM2D-K*$A``D``#X!#2$!*'V<$=A\'P$CN``,`$$S?`/].7DYU5$]P`'(`8.IP5
  851. XM!4ZY````!DY6``!(Y_\`3.X`\``(2$0R!`)!?_!G``".2$8P!@)`?_!G``!P+
  852. XMD$$&0#_P:P``>#(&N4%;YP)&``\(Q@`$`D0`#PC$``1(1DA$<AYV`&$B)`-RG
  853. XM%W8`819R">.KU8)K3@1``!!K```LUH/5@F!`WH?=AKR$7,G_^`/#GH6=A%O)J
  854. XM_^YJ#-Z%W80#@TI!7<G_X$YU5(]T`'8`2.X`#``03-\`_TY>3G5P!4ZY````T
  855. XM!GP`!H,```@`U89D"N*2XI,&0``0:^)R`#("?@ONJNZK[KE"`8:!2$("0@`/6
  856. XMA$!(0DH?9[9P'P'"8+!.5@``2.?@`'``(BX`"&=(-#Q!X$A!,`%F"DA!,`%R'
  857. XM``1"`0!"00Q``/]B#.&(X9F``4(!!$(`@$I`:PH$0@`0TH'10&KVZXCKF8`!!
  858. XM0@%(0`)```^`0DA`2.X``P`(3-\`!TY>3G5.=4Y6``!(Y^``("X`"..8)``"U
  859. XM@`#___\"@O\```!F$G``<@!([@`#``A,WP`'3EY.=>:*XHCBD@:".````"(`L
  860. XMYHCFF0*!<````(""8-9.<4YQ3G$J`"/%````!"H((\4`````*@\CQ0````P@2
  861. XM+P`$*@`CQ0````@J.0````R:N0````A0A2/%````4$GY```%^$?Y````5'H+\
  862. XM%MQ7S?_\(_P```#R````%"QX``0B?`````!.KO[:*@`CQ0```!`C^0```!``>
  863. XM``!,*CP```'**'D```!,*44`,BQX``1P!TZN_JIP!4ZN_JIP!DZN_JI"IT*G2
  864. XM0J<B>0```%`O"4*G*D^>_``DG<YA"BYY````#'``3G5.^0``!BQD;W,N;&EB,
  865. XM<F%R>0!.5@``+PX@+@`,(BX`""QX``1.KO\Z+%\J`"U%`!!.7DYU3OD```4L,
  866. XM0KD```!B3OD```<03E8``"\.(FX`""QX``1.KOYB+%].7DYU3E8``"\.*&X`I
  867. XM#"H,(D4@+@`(+'@`!$ZN_=@L7RH`+44`$DY>3G5.5@``*BX`".2-+44`#$Y>_
  868. XM3G5.5@``*BX`".6%+44`#$Y>3G5.5O_^68\O/#NCUPI.N0``!.!)^0```.0H*
  869. XMWRC?/7P``__^.B[__E-%YT5)^0```-0O-%`$+S10`"\Y```!<"\Y```!;$ZY]
  870. XM```#D%"/.B[__N=%2?D```#42?10`"C?*-]2;O_^#&X`$?_^9K9.7DYU3OD`+
  871. XM``8F3E8``%F/>@`O!4ZY```$>$GY```!7"C?*-]9CWH!+P5.N0``!'A)^0``R
  872. XM`60HWRC?68]Z"B\%3KD```1X2?D```%L*-\HWV$`_T)9CWH*+P5.N0``!'A)A
  873. XM^0```)PHWRC?68]Z9"\%3KD```1X2?D```"D*-\HWUF/*CP``"<0+P5.N0``4
  874. XM!'A)^0```*PHWRC?+SD```"P+SD```"L+SD```"P+SD```"L3KD```)24(])3
  875. XM^0```+0HWRC?+SD```"X+SD```"T+SD```"X+SD```"T3KD```)24(])^0``O
  876. XM`+PHWRC?+SD```#`+SD```"\+SD```#`+SD```"\3KD```)24(])^0```,0H*
  877. XMWRC?+SD```#(+SD```#$+SD```#(+SD```#$3KD```)24(])^0```,PHWRC?T
  878. XM+SD```#0+SD```#,+SD```#0+SD```#,3KD```)24(])^0```-0HWRC?+SD`>
  879. XM``#8+SD```#4+SD```#8+SD```#43KD```)24(])^0```-PHWRC?(_Q!(```V
  880. XM````9B/\.Z/7"@```'XC_$+(``````!J(_PZ`Q)O````@B/\1AQ``````&XC&
  881. XM_#A1MQ<```"&(_Q,OKP@````<B/\-J?%K````(HC_%H.&\H```!V(_PU!C>]W
  882. XM````CB/\=)W%K@```'HC_#-6OY4```"20KD```"63EY.^0``"X9.5@``+PXL;
  883. XM>0```&).KO_*+%\J`"U%``A.7DYU3E8``"\.+'D```!B3J[_?"Q?*@`M10`(,
  884. XM3EY.=4Y6```O#B(N``@L>0```&).KO\H+%\J`$J%5L5$!1U%``Q.7DYU3E8`[
  885. XM`"\.+'D```!B3J[_Q"Q?*@`M10`(3EY.=4Y6```O#B(N`!`D+@`,)BX`""QY!
  886. XM````8DZN_[XL7RH`+44`%$Y>3G5.5@``+PXB+@`0)"X`#"8N``@L>0```&).5
  887. XMKO_0+%\J`"U%`!1.7DYU3E;__"AN``Q*K@`(9@HY?/__``9.^@!V**X`""\,H
  888. XM58\O+@`(3KD```E:6(\:'RA?2@5G"$(L``1.^@!.+PQ9CR\N``A"IWH!+P5..
  889. XMN0``"9Q/[P`,*A\H7RU%__PO#%F/+RX`"$*G>O\O!4ZY```)G$_O``PJ'RA?)
  890. XM*44`"$JL``A7Q40%&44`!$)L``9.7DYU3E;__"AN``I*E&-4+PQ9CR\41^X`-
  891. XM""H++P5Z`2\%3KD```G$3^\`#"H?*%\M1?_\>@&ZKO_\9QPO#%F/3KD```D^-
  892. XM*A\H7SE%``89?``!``1.^@`*0FP`!D(L``1.^@`(.7S__P`&3EY.=4Y6__HHC
  893. XM;@`.2I1C`F`$3OH`@$)N__HZ+O_ZNFX`#&(4.B[_^B9N``A*,U``9P92;O_Z/
  894. XM8.(O#%F/+Q0F;@`(*@LO!7H`.B[_^B\%3KD```G$3^\`#"H?*%\M1?_\>@`Z+
  895. XM+O_ZNJ[__&<<+PQ9CTZY```)/BH?*%\Y10`&&7P``0`$3OH`"D)L``9"+``$D
  896. XM3OH`"#E\__\`!DY>3G5.^0``!PI.5@``2KD```!B9AY9CS\\``I(>0``"[A"0
  897. XMITZY```&4$_O``HCWP```&).7D[Y```+V&1O<RYL:6)R87)Y`$Y6``!".0``.
  898. XM`71.7DYU3OD```N`3E8``&$`_^9.7D[Y```,3$Y6``!(>0```88?+@`(3KD`S
  899. XM``I\7(].7DYU3E8``!\\``IA`/_<5(].7DYU3E8``$AY```!AC\N``PH;@`(Z
  900. XM2%1.N0``"N9/[P`*2GD```&,5\5$!1/%```!=DY>3G5.^0``"]).5@``2KD`9
  901. XM``!B9AY9CS\\``I(>0``#.!"ITZY```&4$_O``HCWP```&)".0```7A(>0``G
  902. XM`7I9CTZY```)(DZY```)[%"/2?D```%Z1_D```&2)MPFW";<2'D```&&68].$
  903. XMN0``"8!.N0``">Q0CTGY```!AD?Y```!GB;<)MPFW$Y>3OD```SR:6X^(```Q
  904. XM;W5T/B``9&]S+FQI8G)A<GD`3OD```Q&3E8``%F//SP`"DAY```00D*G3KD`,
  905. XM``903^\`"B/?````8C\\`!U(>0``$$Y.N0``#!1<CTZY```,`B/Y````8@``>
  906. XM`:I9CRAY```!JBAL`"(O+``83KD```:(6(\CWP```:Y9CRAY```!KB\L``1.:
  907. XMN0``!HA8CR/?```!LD(Y```!NDJY```!LF<"8`1.^@#068\H>0```;(O+``HS
  908. XM3KD```:(6(\CWP```;8H>0```;8,+`!$``%F0"AY```!M@PL`$@``F8R*'D`#
  909. XM``&V#"P`,``#9B0_/``72'D``!!N3KD```P47(].N0``#`(H>0```;89?`!:K
  910. XM``$H>0```;8,+`!$``%F/"AY```!M@PL`$8``F8N*'D```&V#"P`,0`#9B`_M
  911. XM/``V2'D``!"(3KD```P47(].N0``#`(3_``!```!NEF/*'D```&R+Q1.N0``#
  912. XM!HA8CR/?```!LF``_R9*.0```;IF`F`$3OH!T%F/*'D```&N+RP`!$ZY```&V
  913. XMB%B/(]\```&R2KD```&R9P)@!$[Z`:A9CRAY```!LB\L`"A.N0``!HA8CR/?5
  914. XM```!MBAY```!M@PL`$0``68>*'D```&V#"P`1@`"9A`H>0```;8,+``R``-F)
  915. XM`F`$3OH!0C\\`"1(>0``$,!.N0``#!1<CTZY```,`EF/>BPO!2\\``$``4ZY^
  916. XM```&!%"/(]\```&\*'D```&R)GD```&\)I19CR\Y```!O$ZY```&=EB/*'D`J
  917. XM``&R*)\H>0```;(F>0```;PG;``$``0H>0```;(F>0```;PG;``(``@H>0``Y
  918. XM`;(F>0```;PG;``,``PH>0```;(F>0```;Q)[``01^L`$";<)MPFW"AY```!9
  919. XMLB9Y```!O"=L`!P`'"AY```!LB9Y```!O"=L`"``("AY```!LB9Y```!O"=L?
  920. XM`"0`)%F/>@0O!2\\``$``4ZY```&!%"/(]\```&V68\O.0```;9.N0``!G98:
  921. XMCRAY```!O"E?`"@H>0```;88O``#*'D```&V&7P`1``!*'D```&V&7P`1@`"S
  922. XM*'D```&V&7P`,0`#68\H>0```;(O%$ZY```&B%B/(]\```&R8`#^3B\Y````E
  923. XM8DZY```&.%B/3EY.=0````!D;W,N;&EB<F%R>0!:05!$:#`@=C$N,R!">2!*:
  924. XM;VAN($1A=FES(#8O.3```"`@(')E;F%M960@1$@P.B!T;R!:2#`Z(```("`@+
  925. XM9F]U;F0@97AI<W1I;F<@1$8Q.BP@=VEL;"!N;W0@871T96UP="!T;R!R96YA9
  926. XM;64@1$8R.@`@("!F;W5N9"!D9C(Z+"!C<F5A=&EN9R!C;&]N92!A<R!D9C$Z-
  927. XM```````#[````%(``````````@```=@```'D```!\````?X```(,```"&```9
  928. XM`DP```.,```$.@``!6P```6````%J@``!?0```8H```&-```!J@```;@```'\
  929. XM#```!QP```<R```'2```!V(```=X```'D@``![H```?D```(#@``"#@```ABD
  930. XM```(C```"1X```H2```*.```"E@```J<```*N@``"S(```M4```+@@``"YH`S
  931. XM``NB```+M```"]0```OD```+^```#"H```Q(```,8```#&@```R&```,C```1
  932. XM#*X```RT```,T```#.X```S^```-!@``#1H```T@```-*```#4@```UB```-'
  933. XMD```#<P```W2```-V@``#AH```X@```.*```#D````YL```.E```#M8```[<S
  934. XM```.Y```#O8```\:```/O```#](``!`<```0-````)L````!````G````-@`+
  935. XM``#T```!#```!38```4^```%1@``!5(```58```%7@``!68```5R```%A```,
  936. XM!9H```6@```%I```!;````76```%Z@``!BX```:N```&Q@``!M0```;:```&@
  937. XM[@``!R(```<X```'3@``!V@```=^```'F```!Z(```>H```'K@``![0```?"/
  938. XM```'S```!](```?8```'W@``!^P```?V```'_```"`(```@(```(%@``""``#
  939. XM``@F```(+```"#(```A````(2@``"%````A6```(7```"&H```AT```(>@```
  940. XM"(````B&```(E```"*(```BL```(M@``",````C*```(U```"-X```CH```(B
  941. XM\@``"/P```D&```)$```"18```DJ```)1@``"68```F(```)L```"=@```N,P
  942. XM```+K```"\H```ON```,&@``##0```P^```,4@``#'(```QX```,?@``#)0`_
  943. XM``R:```,I@``#+P```S"```-$```#2X```TR```-.@``#5````U8```-:@``%
  944. XM#7````UV```-A@``#9@```V>```-K```#;H```W@```-[```#?H```X(```.T
  945. XM,```#C@```Y(```.4@``#F(```YT```.>@``#HH```Z<```.H@``#K````Z^B
  946. XM```._@``#P0```\*```/%```#R(```\J```/,```#SP```]"```/3@``#U0`@
  947. XM``]@```/9@``#WH```^````/C```#Y(```^>```/I```#\0```_,```/V@``O
  948. XM#^0```_N```/^@``$`8``!`4```0)```$"X````````#\@```^L```!P```#[
  949. X-\@```^H````````#\@8`:
  950. X``
  951. Xend
  952. Xsize 5368
  953. END_OF_FILE
  954. if test 7554 -ne `wc -c <'zapdh0.uu'`; then
  955.     echo shar: \"'zapdh0.uu'\" unpacked with wrong size!
  956. fi
  957. # end of 'zapdh0.uu'
  958. fi
  959. echo shar: End of archive 1 \(of 1\).
  960. cp /dev/null ark1isdone
  961. MISSING=""
  962. for I in 1 ; do
  963.     if test ! -f ark${I}isdone ; then
  964.     MISSING="${MISSING} ${I}"
  965.     fi
  966. done
  967. if test "${MISSING}" = "" ; then
  968.     echo You have the archive.
  969.     rm -f ark[1-9]isdone
  970. else
  971.     echo You still need to unpack the following archives:
  972.     echo "        " ${MISSING}
  973. fi
  974. ##  End of shell archive.
  975. exit 0
  976. -- 
  977. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  978. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  979. Post requests for sources, and general discussion to comp.sys.amiga.
  980.